home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Archive-tools / LZSS Res ƒ / LZSSExample.c < prev    next >
C/C++ Source or Header  |  1993-06-06  |  1KB  |  52 lines

  1. /*
  2.     Copyright © 1994 Demos, inc.
  3.     Written by: Dmitry Boldyrev
  4. */
  5.  
  6. #include "LZSSLib.h"
  7. #include "utils.h"
  8.  
  9. void InitToolbox(void)
  10. {
  11.     InitGraf(&qd.thePort);
  12.     InitFonts();
  13.     InitWindows();
  14.     InitMenus();
  15.     TEInit();
  16.     InitDialogs(nil);
  17.     InitCursor();
  18.     InitResources();
  19.     FlushEvents(everyEvent,0);
  20.     SetEventMask(everyEvent);
  21.     MaxApplZone();
  22. }
  23.  
  24. main()
  25. {
  26.     Handle                theHandle;
  27.     PicHandle            aPicture;
  28.     short                rAttrs, i, ac;
  29.     ResType                res;
  30.     WindowPtr            theWindow;
  31.     Rect                winarea, picRect;
  32.     
  33.     InitToolbox();
  34.     
  35.     theWindow = (WindowPtr)CreateWindow( &screenBits.bounds, "\p", plainDBox, 0L);
  36.     HideMenuBar(theWindow);
  37.     SetPort( (WindowPtr)theWindow );
  38.     FillRect( &thePort->portRect, black );
  39.  
  40.     if ((theHandle = GetCResource('PICT', 5002)) == nil)
  41.         ExitToShell();
  42.  
  43.     aPicture = (PicHandle)theHandle;
  44.     picRect = (*aPicture)->picFrame;
  45.     CenterRect(theWindow->portRect, &picRect);
  46.     DrawPicture(aPicture, &picRect);
  47.     while (!Button());
  48.     ShowMenuBar(theWindow);
  49.  
  50.     DisposeHandle(theHandle);
  51.     DisposeWindow(theWindow);
  52. }